import Vue from "vue";
import VueRouter from "vue-router";
import home from "@/views/home";
import addblog from "@/views/addblog";
import message from "@/views/message";
import about from "@/views/about";

//1.安装插件
Vue.use(VueRouter)

//2.创建路由对象
const routes = [
  {
    path:'',
    redirect:'/home'
  },
  {
    path:'/home',
    component:home
  },
  {
    path:'/addblog',
    component:addblog
  },{
    path:'/message',
    component:message
  },{
    path:'/about',
    component:about
  }
]
const router = new VueRouter({
  routes
})

//3.导出router
export default router